<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:cc="http://xmlns.jcp.org/jsf/composite/ezcomp"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <f:view contentType="text/html">
        <h:head>

            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title><ui:insert name="title">Meteocal</ui:insert></title>
            </f:facet>
        </h:head>

        <h:body>
            <h:outputStylesheet  name="css/meteocal.css"  />
            <p:growl id="errorMessages" sticky="true" showDetail="true" severity="error" />
            <p:growl id="infoMessages" sticky="false" showDetail="true" severity="info,warn" life="5000" />
            <p:layout fullPage="true">

                <p:layoutUnit position="north" size="100"  collapsible="true" gutter="0">



                    <cc:optionsMenu id="options" />
                    <h:form id="search">
                        <p:inputText id="text" placeholder="search" value="#{userHome.userEmail}" />
                        <p:commandButton id="button" icon="ui-icon-search" 
                                         title="Search a user" actionListener="#{userHome.submitSearch}" 
                                         update="_usersearch_userbrowsing"
                                         oncomplete="PF('userBrowsing').show();"/>
                    </h:form>

                    <cc:dynamiLogo id="logo" text="#{editProfile.name} #{editProfile.surname}" />
                </p:layoutUnit>

                <p:layoutUnit position="center" collapsible="true" gutter="0" >
                    <h:form id="usersearch">
                        <p:dialog widgetVar="userBrowsing" id="userbrowsing" header="User Browsing" showEffect="clip" hideEffect="clip">
                            <p:panel id="browsePanel" >
                                <c:if test="#{not empty userHome.userFound}" >

                                    <h:outputText id="userR" value="#{userHome.userFound}" />
                                    <h:commandButton  action="#{userHome.showOtherUserHome(userHome.user)}" value="Show Calendar" />
                                </c:if>
                            </p:panel>
                        </p:dialog>
                    </h:form>
                    <ui:insert name="content">

                        center

                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit position="south" size="50" collapsible="true" gutter="0">
                    <ui:include src="../pageFragments/footer.xhtml" />
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>

